import java.util.Scanner;
public class test410 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int day = 0;
        System.out.println("Is your birthday in this group?");
        System.out.println("1  3  5  7  9  11  13  15  17  19  21  23  25  27  29  31");
        System.out.print("Enter Y (yes) or N (no): ");
        String ans = scanner.next().toUpperCase();
        if (ans.equals("Y")) day += 1;
        System.out.println("\nIs your birthday in this group?");
        System.out.println("2  3  6  7  10  11  14  15  18  19  22  23  26  27  30  31");
        System.out.print("Enter Y (yes) or N (no): ");
        ans = scanner.next().toUpperCase();
        if (ans.equals("Y")) day += 2;
        System.out.println("\nIs your birthday in this group?");
        System.out.println("4  5  6  7  12  13  14  15  20  21  22  23  28  29  30  31");
        System.out.print("Enter Y (yes) or N (no): ");
        ans = scanner.next().toUpperCase();
        if (ans.equals("Y")) day += 4;
        System.out.println("\nIs your birthday in this group?");
        System.out.println("8  9  10  11  12  13  14  15  24  25  26  27  28  29  30  31");
        System.out.print("Enter Y (yes) or N (no): ");
        ans = scanner.next().toUpperCase();
        if (ans.equals("Y")) day += 8;
        System.out.println("\nIs your birthday in this group?");
        System.out.println("16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31");
        System.out.print("Enter Y (yes) or N (no): ");
        ans = scanner.next().toUpperCase();
        if (ans.equals("Y")) day += 16;
        System.out.println("\nYour birthday is " + day + "!");
        scanner.close();
    }
}

